﻿@{
    Layout = null;
    var Parents = ViewData["Parents"] as SelectList;
    int SourceID = 0;
    //int.TryParse(ViewData["SourceID"] as string, out SourceID);
    SourceID = Convert.ToInt32(ViewData["SourceID"]);
    int i = 1;
   
    var MemberGrade = ViewData["MemberGrade"] as SelectList;
    var Degree = ViewData["Degree"] as SelectList;
    var SexList = ViewData["SexList"] as SelectList;
    var Members = ViewData["Members"] as List<HanGu.Entity.MemberInfo>;
    Members = Members ?? new List<HanGu.Entity.MemberInfo>();
}
<div class="pageContent">
    <script>
        $(function () {
            $("#MoveMembersForm #SourceValue").val("@SourceID");

        });
    </script>
    <form method="post" id="MoveMembersForm" action="Users/Default/MoveMember?OpID=@ViewData["OperateID"]" class="pageForm required-validate"
    onsubmit="return validateCallback(this, navTabAjaxDone);">
    @Html.ValidationSummary(true)
    @Html.Hidden("SourceID", SourceID)
    <div class="pageFormContent" layouth="56">
        <div>
            <label>
                目标用户：</label>
            @foreach (var item in Parents)
            {
                if (item.Value != SourceID.ToString())
                {
                <label style="width: auto; white-space: nowrap">
                    <input name="AssignedIns" class="checkbox required" id="AssignedIns" style="magin-left: 5px;" type="checkbox" value="@item.Value"/>
                    @item.Text
                </label>
                }
            }
        </div>
        <div class="divider"></div>
            <table class="table" width="100%" layouth="170">
                <thead>
                    <tr class="header">
                        <th>
                            <input type="checkbox" class="checkboxCtrl" group="moveMembers" />选择
                        </th>
                        <th style="width: 50px">
                            序号
                        </th>
                        <th>
                            姓名
                        </th>
                        <th>
                            性别
                        </th>
                        <th>
                            学位
                        </th>
                        <th>
                            级别
                        </th>
                        <th>
                            积分
                        </th>
                        <th>
                            电话
                        </th>
                        <th>
                            注册时间
                        </th>
                    </tr>
                </thead>
                @foreach (var item in Members)
                {            
                    <tr id="memberItem">
                        <td>
                            <input  type="checkbox" class="chceckbox required" name="moveMembers" id="moveMembers" value="@item.ID" checked="checked"/>
                        </td>
                        <td>
                            @i
                        </td>
                        <td>
                            @item.RealName
                        </td>
                        <td>
                            @{
                    var modelsex = SexList.SingleOrDefault(c => c.Value == item.Sex);
                    if (modelsex != null)
                    {
                                @modelsex.Text
                    }
                            }
                        </td>
                        <td>
                            @{
                    var modelDegree = Degree.SingleOrDefault(c => c.Value == item.Degree);
                    if (modelDegree != null)
                    {
                                @modelDegree.Text
                    }   
                            }
                        </td>
                        <td>
                            @{
                    var modelGrade = MemberGrade.SingleOrDefault(c => c.Value == item.Grade);
                    if (modelGrade != null)
                    { 
                                @modelGrade.Text;
                    }
                            }
                        </td>
                        <td>
                            @item.Charge
                        </td>
                        <td>
                            @item.Tel
                        </td>
                        <td>
                            <span formatdate="yyyy-MM-dd HH:mm">
                                @item.CreateTime</span>
                        </td>
                    </tr>
                    i += 1;
                }
            </table>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                提交</button></div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消</button></div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
